package com.chen.serviceorder.generator;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.util.Collections;

/**
 * @author chenLiuPing
 **/
public class MysqlGenerator {
    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:mysql://localhost:3306/service-order?characterEncoding=utf-8&serverTimezone=Asia/Shanghai",
                "root", "root")
                .globalConfig(builder -> {
                    builder.author("chenliuping").outputDir("C:\\Users\\LEGION\\Desktop\\online-taxi\\service-order\\src\\main\\java");
                })
                .packageConfig(builder -> {
                    builder.parent("com.chen.serviceorder").pathInfo(Collections.singletonMap(OutputFile.mapper,
                            "C:\\Users\\LEGION\\Desktop\\online-taxi\\service-order\\src\\main\\java\\com\\chen\\serviceorder\\mapper"));
                })
                .strategyConfig(builder -> {
                    builder.addInclude("order");
                })
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
    }
}
